From 5cf031e58df9bede3e6751f2905257c3e0ed8642 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 18 Oct 2005 15:40:29 +0100 Subject: [PATCH] alloc_netif() must return a ERR_PTR() on error, not NULL. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/drivers/xen/netback/interface.c | 4 ++-- linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c index 43f516badf..404eb98831 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c @@ -58,7 +58,7 @@ netif_t *alloc_netif(domid_t domid, unsigned int handle, u8 be_mac[ETH_ALEN]) dev = alloc_netdev(sizeof(netif_t), name, ether_setup); if (dev == NULL) { DPRINTK("Could not create netif: out of memory\n"); - return NULL; + return ERR_PTR(-ENOMEM); } netif = netdev_priv(dev); @@ -104,7 +104,7 @@ netif_t *alloc_netif(domid_t domid, unsigned int handle, u8 be_mac[ETH_ALEN]) DPRINTK("Could not register new net device %s: err=%d\n", dev->name, err); free_netdev(dev); - return NULL; + return ERR_PTR(err); } DPRINTK("Successfully created netif\n"); diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c index 905ca8b801..6d81bb7433 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c @@ -28,10 +28,6 @@ struct backend_info netif_t *netif; long int frontend_id; -#if 0 - long int pdev; - long int readonly; -#endif /* watch back end for changes */ struct xenbus_watch backend_watch; @@ -155,14 +151,6 @@ static void backend_changed(struct xenbus_watch *watch, return; } -#if 0 - err = vbd_create(be->netif, handle, be->pdev, be->readonly); - if (err) { - xenbus_dev_error(dev, err, "creating vbd structure"); - return; - } -#endif - kobject_hotplug(&dev->dev.kobj, KOBJ_ONLINE); /* Pass in NULL node to skip exist test. */ -- 2.30.2